package proxy;

/**
 * 委托实现类
 * @author Xewee.Zhiwei.Wang
 * @version 2012-2-22 上午10:43:54
 */

public class DelegatorImpl implements IDelegator.One, IDelegator.Two,
		IDelegator.Three {

	@Override
	public String read() {
		this.print();
		return "";
	}

	@Override
	public int write() {
		this.print();
		return 0;
	}

	@Override
	public void sing() {
		this.print();
	}

	private void print() {
		String message = "Invoke "
				+ Thread.currentThread().getStackTrace()[2].getClassName()
				+ "."
				+ Thread.currentThread().getStackTrace()[2].getMethodName();
		System.out.println(message);
	}
}
